package com.yaolifei.flower.core.impl;

import java.util.Arrays;
import java.util.List;

import org.nutz.dao.Dao;
import org.nutz.dao.impl.NutDao;
import org.nutz.dao.jdbc.JdbcExpert;
import org.nutz.lang.Mirror;

import com.yaolifei.flower.core.CustomJdbcExpert;

public class CustomJdbcExportFactory {
	private static List<Class<?>> experts = Arrays.<Class<?>>asList(CustomMySqlJdbcExpert.class);
//	private JdbcExpertConfigFile

	public static CustomJdbcExpert getJdbcExpert(Dao dao) {
		JdbcExpert expert = ((NutDao)dao).getJdbcExpert();
		for (Class<?> cls : experts) {
			if (expert.getClass().isAssignableFrom(cls)) {
				return (CustomJdbcExpert) Mirror.me(cls).born();
			}
		}
		return null;
	}
	
}
